package com.uwo.commons.samples.beans.validate;

import com.uwo.commons.kits.JsonKits;
import com.uwo.commons.samples.beans.Member;
import com.uwo.commons.samples.beans.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component(value = "modelValidate")
public class ModelValidate {

    private final Logger log = LoggerFactory.getLogger(ModelValidate.class);

    public void validateUser(User user){

        log.warn("username = {}, password = {}", user.getName(), user.getPassword());
    }

    public void validateMember(Member member){
        log.warn("member = {}", JsonKits.object2Json(member));
    }

}
